package com.cloudshadow.platform.server.common.base.service;

import com.cloudshadow.platform.server.common.base.dao.BaseDao;
import com.cloudshadow.platform.server.common.base.model.BaseModel;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Sort;

import java.io.Serializable;
import java.util.List;

/**
 * 
 * @author shenmy14613
 *
 * @param <T>操作的模型类
 * @param <K>主键类型
 */
public interface BaseService<Dao extends BaseDao<T,K>, T extends BaseModel, K extends Serializable> {

	public List<T> findAll();

	public List<T> findAll(T entity);

	public Page<T> findByPage(T entity, Integer page, Integer size, Sort sort);

	public T findOneByID(K id);

	public T save(T entity);

	public void delete(K id);


	public T getOne(T entity);
}
